import { axios } from '@/utils/request'
import { method } from 'lodash'

/**
 * 数据统计
 * @param {*} id
 * @returns
 */
export function shortCount(parameter){
  return axios({
    url: `/backvd/data/info`,
    method: 'get',
    data: parameter
  })
}

export function shortEpisodesList(parameter){
  return axios({
    url: '/backvd/vsDramaVideoEpisodes/list',
    method: 'post',
    data: parameter
  })
}

/**
 * 数据统计
 * @param {*} id
 * @returns
 */
export function shortDataCount(parameter){
  return axios({
    url: `/backvd/data/statistics`,
    method: 'get',
    data: parameter
  })
}

/**
 * 短剧列表
 * @param {*} parameter
 * @returns
 */
export function shortVideoList (parameter) {
  return axios({
    url: '/backvd/video/list',
    method: 'post',
    data: parameter
  })
}
/**
 * 短剧创建编辑
 * @param {Object} parameter
 * @param {String} type add || update
 * @returns
 */
export function shortVideoAddOrUpdate (parameter){
  const type = parameter.id ? 'update' : 'add'
  return axios({
    url: `/backvd/video/${type}`,
    method: 'post',
    data: parameter
  })
}
/**
 * 短剧详情
 * @param {*} id
 * @returns
 */
export function shortVideoDetail(id){
  return axios({
    url: `/backvd/video/detail/${id}`,
    method: 'get'
  })
}

// **************************  提现 ***************************

/**
 * 提现列表
 * @param {*} parameter
 * @returns
 */
export function shortTxList(parameter){
  return axios({
    url: "/backvd/userWithdraw/list",
    method: "post",
    data: parameter
  })
}
/**
 * 提现审核
 * @param {*} parameter
 * @returns
 */
export function shortTxAudit(parameter){
  return axios({
    url: "/backvd/userWithdraw/audit",
    method: "post",
    data: parameter
  })
}

// **************************  产品 ***************************

/**
 * 产品列表
 * @param {*} parameter
 * @returns
 */
export function shortProductList(parameter){
  return axios({
    url: "/backvd/product/list",
    method: "post",
    data: parameter
  })
}

/**
 * 产品创建编辑
 * @param {Object} parameter
 * @param {String} type add || update
 * @returns
 */
export function shortProductAddOrUpdate (parameter){
  const type = parameter.id ? 'update' : 'add'
  return axios({
    url: `/backvd/product/${type}`,
    method: 'post',
    data: parameter
  })
}

/**
 * 产品详情
 * @param {*} id
 * @returns
 */
export function shortProductDetail(id){
  return axios({
    url: `/backvd/product/detail/${id}`,
    method: 'get',
  })
}
// **************************  订单 ***************************

/**
 * 订单列表
 * @param {*} parameter
 * @returns
 */
export function shortChargeList(parameter){
  return axios({
    url: "/backvd/charge/list",
    method: "post",
    data: parameter
  })
}

// **************************  用户 ***************************

/**
 * 用户列表
 * @param {*} parameter
 * @returns
 */
export function shortUserList (parameter) {
  return axios({
    url: '/backvd/adminUser/list',
    method: 'post',
    data: parameter
  })
}
/**
 * 用户创建编辑
 * @param {Object} parameter
 * @param {String} type add || update
 * @returns
 */
export function shortUserAddOrUpdate (parameter){
  const type = parameter.id ? 'update' : 'add'
  return axios({
    url: `/backvd/adminUser/${type}`,
    method: 'post',
    data: parameter
  })
}
/**
 * 用户详情
 * @param {*} id
 * @returns
 */
export function shortUserDetail(id){
  return axios({
    url: `/backvd/adminUser/detail/${id}`,
    method: 'get'
  })
}

/**
 * 用户详情
 * @param {*} id
 * @returns
 */
export function shortUserQr(id){
  return axios({
    url: `/backvd/adminUser/qr`,
    method: 'get'
  })
}


// **************************  会员 ***************************
/**
 * 会员列表
 * @param {*} id
 * @returns
 */
export function shortMemberList(parameter){
  return axios({
    url: '/backvd/user/list',
    method: 'post',
    data: parameter
  })
}
/**
 * 会员创建编辑
 * @param {Object} parameter
 * @param {String} type add || update
 * @returns
 */
export function shortMemberAddOrUpdate (parameter){
  const type = parameter.id ? 'update' : 'add'
  return axios({
    url: `/backvd/user/${type}`,
    method: 'post',
    data: parameter
  })
}
/**
 * 会员详情
 * @param {*} id
 * @returns
 */
export function shortUserInfo(parameter){
  return axios({
    url: '/backvd/user/info',
    method: 'post',
    data: parameter
  })
}

/**
 * 奖品列表
 * @param {*} parameter
 * @returns
 */
export function shortRewardList (parameter){
  return axios({
    url: '/backvd/reward/list',
    method: 'post',
    data: parameter
  })
}

export function rewardHbList (parameter){
  return axios({
    url: '/backvd/rewardHb/list',
    method: 'post',
    data: parameter
  })
}

export function rewardHbSend (parameter){
  return axios({
    url: '/backvd/rewardHb/send',
    method: 'post',
    data: parameter
  })
}


export function rewardHbSet (parameter){
  return axios({
    url: '/backvd/rewardHb/set',
    method: 'post',
    data: parameter
  })
}

/**
 * 管理员审核
 * @param parameter
 * @returns {AxiosPromise}
 */
export function rewardHbAudit (parameter){
  return axios({
    url: '/backvd/rewardHb/audit',
    method: 'post',
    data: parameter
  })
}

export function rewardHbApply (parameter){
  return axios({
    url: '/backvd/rewardHb/apply',
    method: 'post',
    data: parameter
  })
}

export function rewardHbApplyList (parameter){
  return axios({
    url: '/backvd/rewardHb/apply/list',
    method: 'post',
    data: parameter
  })
}



export function appVersionList (parameter) {
  return axios({
    url: '/backvd/vsVersion/list',
    method: 'POST',
    data: parameter
  })
}


export function addAppVersion (parameter) {
  return axios({
    url: '/backvd/vsVersion/add',
    method: 'POST',
    data: parameter
  })
}

/**
 * 业务员详情
 * @param id
 * @returns {AxiosPromise}
 */
export function adminUserDetail(id){
  return axios({
    url: `/backvd/adminUser/detail/${id}`,
    method: 'post',
    data: {}
  })
}

/**
 * 业务员详情
 * @returns {AxiosPromise}
 */
export function adminUser(){
  return axios({
    url: `/backvd/adminUser/loginInfo`,
    method: 'get',
    data: {}
  })
}



export function PayConfigList(data){
  return axios({
    url: '/backvd/pay/config/list',
    method: 'post',
    data
  })
}

export function PayConfigUpdate (id, data){
  return axios({
    url: `/backvd/pay/config/update/${id}`,
    method: 'post',
    data: data
  })
}


export function CustomeConfigDetails (id, data){
  return axios({
    url: `/backvd/adminCustomerService/detail/${id}`,
    method: 'get',
    data: data
  })
}


export function CustomerServiceAdd (data){
  return axios({
    url: '/backvd/adminCustomerService/add',
    method: 'post',
    data
  })
}

export function CustomerServiceList (data){
  return axios({
    url: '/backvd/adminCustomerService/list',
    method: 'post',
    data
  })
}

export function CustomerServiceUpdate (data){
  return axios({
    url: '/backvd/adminCustomerService/update',
    method: 'post',
    data: data
  })
}


export function CustomerServiceUpdateState (id) {
  return axios({
    url: `/backvd/adminCustomerService/updateState/${id}`,
    method: 'get'
  })
}